﻿import { AbpModule } from '@abp/abp.module';
import * as ngCommon from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppLocalizationService } from '@app/shared/common/localization/app-localization.service';
import { AppNavigationService } from '@app/shared/layout/nav/app-navigation.service';
import { CommonModule } from '@shared/common/common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { ModalModule, TabsModule } from 'ngx-bootstrap';
import { PaginatorModule, CalendarModule, MultiSelectModule, TreeModule, FileUploadModule } from 'primeng/primeng';
import { TableModule } from 'primeng/table';
import { AppAuthService } from './auth/app-auth.service';
import { AppRouteGuard } from './auth/auth-route-guard';
import { CommonLookupModalComponent } from './lookup/common-lookup-modal.component';
import { EntityTypeHistoryModalComponent } from './entityHistory/entity-type-history-modal.component';
import { EntityChangeDetailModalComponent } from './entityHistory/entity-change-detail-modal.component';
import { ExcelImportComponent } from './excel/excel-import.component';
import { ExcelPreviewComponent } from './excel/excel-preview.component';
import { DtoExtendEditComponent } from './dto-extend/dto-extend.component';
import { ExcelExportComponent } from './excel/excel-export.component';
import { SimpleAccountBaseInfoModalComponent } from './stockbase/account-base-info-modal.component';
import { InventoryBaseComponent } from './stockbase/inventory/inventory-base.component';
import { CreateOrEditInventoryBillModalComponent } from './stockbase/inventory/create-or-edit-inventory-bill-item-modal.component';
import { AuditLogComponent } from './auditlog/audit-log-modal.component';
import { CamcMultiSelectComponent, CamcMultiSelectItem } from './mutiselect/mutiselect.component';
import { CamcDropdownItem, CamcDropdownComponent, CamcDropdownAutoComponent } from './dropdown/dropdown.component';
import { CodeItemsTreeComponent } from './codeitemtree/codeitems-tree.component';
import { DateMonthDayRangeComponent } from './timing/date-month-day-range.component';
import { BaseFieldDetailModalComponent } from './stockbase/basefield-detail-modal.component';
import { AccountRecordModalComponent } from './stockbase/record-modal.component';
import { BillItemDetailModalComponent } from './stockbase/bill-item-detail-modal.component';
import { CreateOrEditBaseInfoModalComponent } from './stockbase/create-or-edit-baseinfo-modal.component';
import { UserCardModalComponent } from './stockbase/user-card-modal.component';

@NgModule({
    imports: [
        ngCommon.CommonModule,
        FormsModule,
        ReactiveFormsModule,
        ModalModule.forRoot(),
        UtilsModule,
        AbpModule,
        CommonModule,
        MultiSelectModule,
        TableModule,
        PaginatorModule,
        CalendarModule,
        TreeModule,
        FileUploadModule,
        TabsModule.forRoot()
    ],
    declarations: [
        CommonLookupModalComponent,
        EntityTypeHistoryModalComponent,
        EntityChangeDetailModalComponent,
        ExcelImportComponent,
        ExcelExportComponent,
        ExcelPreviewComponent,
        DtoExtendEditComponent,
        CreateOrEditBaseInfoModalComponent,
        CodeItemsTreeComponent,
        SimpleAccountBaseInfoModalComponent,
        InventoryBaseComponent,
        CreateOrEditInventoryBillModalComponent,
        AuditLogComponent,
        CamcMultiSelectItem,
        CamcMultiSelectComponent,
        CamcDropdownItem,
        CamcDropdownComponent,
        CamcDropdownAutoComponent,
        DateMonthDayRangeComponent,
        BaseFieldDetailModalComponent,
        AccountRecordModalComponent,
        BillItemDetailModalComponent,
        UserCardModalComponent,
    ],
    exports: [
        CommonLookupModalComponent,
        EntityTypeHistoryModalComponent,
        EntityChangeDetailModalComponent,
        ExcelImportComponent,
        ExcelExportComponent,
        ExcelPreviewComponent,
        DtoExtendEditComponent,
        UserCardModalComponent,
        DateMonthDayRangeComponent,
        BaseFieldDetailModalComponent,
        AccountRecordModalComponent,
        BillItemDetailModalComponent,
        CodeItemsTreeComponent,
        SimpleAccountBaseInfoModalComponent,
        InventoryBaseComponent,
        CreateOrEditInventoryBillModalComponent,
        AuditLogComponent,
        CamcMultiSelectComponent,
        CamcDropdownComponent,
        CamcDropdownAutoComponent,
    ],
    providers: [AppLocalizationService, AppNavigationService]//DateTimeService
})
export class AppCommonModule {
    static forRoot(): ModuleWithProviders {
        return {
            ngModule: AppCommonModule,
            providers: [AppAuthService, AppRouteGuard]
        };
    }
}
